#!/bin/bash

. ./envars.sh

# 2^ - 2
decoy_count=2

export yhashes=(`node read_all_zthacc_yhashes.js`)
export conadd=`node read_last_zether_address.js`

from_yhash=${yhashes[0]}
to_yhash=${yhashes[1]}

# echo ${yhashes[@]}
# echo ${yhashes[@]:2:${decoy_count}}

${ZETHER_COMMAND} zth transfer $from_yhash $to_yhash $conadd 5 --decoys ${yhashes[@]:2:${decoy_count}}
